package xyz.msj.hrm.feign.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import xyz.msj.hrm.doc.CourseDocument;
import xyz.msj.hrm.feign.fallback.CourseFeignClientFallBack;
import xyz.msj.hrm.query.CourseQuery;
import xyz.msj.hrm.util.AjaxResult;

/**
 * feign接口
 */
@FeignClient(value = "search-server",fallbackFactory = CourseFeignClientFallBack.class )
public interface CourseFeignClient {
    /**
     * 保存数据到es
     *
     * @return
     */
    @RequestMapping("/es/save")
    AjaxResult save(@RequestBody CourseDocument courseDocument);

    /**
     * 删除es数据
     *
     * @return
     */
    @RequestMapping("/es/del")
    AjaxResult delete(@RequestBody CourseDocument courseDocument);

    /**
     * 根据条件查询课程对象
     *
     * @param courseQuery
     * @return
     */
    @RequestMapping("/es/search")
    AjaxResult search(@RequestBody CourseQuery courseQuery);
}